/******************************************************************************/
/*  Class SETT_MEM                                                            */
/*  PO: S. Maslyakov, rusoil.9@gmail.com                                      */
/*                                                                            */
/*  Revision:     1.0                                                         */
/*  Date:         2011/01/08 21:54:33                                         */
/******************************************************************************/


#ifndef __SETT_MEM_H
#define __SETT_MEM_H


#include "data_types.h"
#include "Fmem_layer\fmem_layer.h"
#include "Sett_mem\sett_mem_def.h"


//==============================================================================
//  Class SETT_MEM
//==============================================================================
class SETT_MEM : FMEM_LAYER
{
public:
  SETT_MEM(const uint32_t _saddr, const uint32_t _memSize, FMEM_LAYER * pSwop) :
           FMEM_LAYER(_saddr, _memSize), m_pSwop(pSwop) {}
  uint32_t WriteDataSwop(const __FMEM_DATA * const _pData);
  uint32_t WriteSwopToMain(const __FMEM_DATA * const _pData);
  using FMEM_LAYER::WriteData;
  using FMEM_LAYER::ReadData;
  using FMEM_LAYER::EraseMemory;

private:
  uint32_t GetSectorStartAddr(const uint32_t _addr);

  FMEM_LAYER * const m_pSwop;
};
//==============================================================================
//==============================================================================


#endif